<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>供应商列表</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<#include "../template/include/assign.ftl">
<#include "../template/include/source.ftl">
<#include "../template/template_listPage.ftl">
<link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	.page{
		float:right;
		padding-top: 15px;
		margin-right: 15px;
	}
</style>
<script type="text/javascript">
$(document).ready(function(){
  $('#searchButton').click( 
  	function () { 
  		$('#currentPage_listForm').val('1');
  	});
  	$('#supplyState').val('<#if supplyQuery??>${(supplyQuery.supplyState)!}</#if>');

    <#if actionErrors??&&(actionErrors?size > 0)>
        $.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
            modal: true, autoCloseTime: 3000});
    </#if>
});
function editSupply(supplyId) {
    var supId = $('#supplyId').val();
    var supplyName = $('#supplyName').val();
    var url = "${web_base}/game/supply_manager!toEdit.htm?supplyId=" + supplyId;
    if(supId != null && supId != ''){
        url = url + "&supId=" + supId;
    }
    if(supplyName != null && supplyName != ''){
        url = url + "&supplyName=" + supplyName;
    }
    document.forms[0].action = encodeURI(url);
    document.forms[0].submit();
}

</script>
</head>
<body class="list">
	<div class="body">
		<div class="listBar">
			<h1><span class="icon">&nbsp;</span>供应商管理&nbsp;<span class="pageInfo"></span></h1>
		</div>
		<@pageList page=(page!) id="listForm" action="${web_base}/game/supply_manager!list.htm" query="supplyQuery" isEmpty=true>
			<div class="operateBar">
				<input type="button" class="addButton" onclick="location.href='${web_base}/game/supply_manager!add.htm'" value="添加供应商" />
				
				<label>查找:</label>
					供应商代码：<input type="text" name="supplyQuery.supplyId" id="supplyId" value="<#if supplyQuery??>${(supplyQuery.supplyId)!}</#if>" />
                    供应商名称：<input type="text" name="supplyQuery.supplyName" id="supplyName"  value="<#if supplyQuery??>${(supplyQuery.supplyName)!}</#if>" />
					供应商状态：<select name="supplyQuery.supplyState" id="supplyState">
						 		<option value="" selected="selected">请选择...</option>
						 		<option value="1" >
									合作
								</option>
								<option value="0" >
									不合作
								</option>
							</select>
					<input type="submit" id="searchButton" class="searchButton" value="" />
			</div>
			<table class="listTable">
				<tr>
					<th width="200">
						<span class="sort" name="supplyId">供应商代码</span>
					</th>
					<th>
						<span class="sort" name="supplyName">供应商名称</span>
					</th>
					<th>
						<span class="sort" name="supplyState">供应商状态</span>
					</th>
					<th width="80">操&nbsp;作<th/>
				</tr>

            <#if page?? && page.list?? && (page.list?size gt 0)>
				<#list page.list as obj>
					<tr>
						<td width="200">
							${(obj.supplyId)!}
						</td>
						<td>
							<#--<#if obj.supplyId=="20121000">
								<a href="${web_base}/game/oh_fly!list.htm?" title="${(obj.supplyName)!}">${(obj.supplyName)!}</a>
							<#elseif obj.supplyId=="20121001">	
								<a href="${web_base}/game/nuts_net!list.htm?" title="${(obj.supplyName)!}">${(obj.supplyName)!}</a>
							<#elseif obj.supplyId=="20121002">	
								<a href="${web_base}/game/tencent!list.htm?" title="${(obj.supplyName)!}">${(obj.supplyName)!}</a>
							<#else>
								${(obj.supplyName)!}
							</#if>-->
							${(obj.supplyName)!}
						</td>
						<td>
							<#if obj.supplyState?? && obj.supplyState=="0">
							不合作
							<#elseif obj.supplyState?? && obj.supplyState=="1">
							合作
							</#if>
						</td>
						<td width="80">
                            <span class="spanLink" onclick="editSupply('${(obj.supplyId)!}');" title="编辑">[编辑]</span>
						</td>
					</tr>
				</#list>
            </#if>
			</table>
			
			<#if page?? && page.list?? && (page.list?size <= 0)>
				<div class="noRecord">
					没有找到任何记录!
				</div>
			</#if>
		</@pageList>
	</div>
	
</body>
</html>